#xxxx is #xx if the register is 8-bit For ADC and SBC: C is when Carry is set, c is when Carry is clear For WAI: PSR.I is when the IRQ disabled For XBA: 'A' and 'B' stand for the two parts of the accumulator For TC[DS]/T[DS]C: 'C' stands for 'A'&'B', meaning the transfer will be 16-bit regardless of PSR.M Subtract a cycle if the register is 8-bit (and relevant) ---------------- Hex Assembly Instruction description A9xxxx LDA #xxxx Load #xxxx to A A2xxxx LDX #xxxx Load #xxxx to X A0xxxx LDY #xxxx Load #xxxx to Y AFxxxxxx LDA xxxxxx Load xx:xxxx to A ADxxxx LDA xxxx Load DB:xxxx to A AExxxx LDX xxxx Load DB:xxxx to X ACxxxx LDY xxxx Load DB:xxxx to Y A5xx LDA xx Load DB:00xx+DP to A A6xx LDX xx Load DB:00xx+DP to X A4xx LDY xx Load DB:00xx+DP to Y BFxxxxxx LDA xxxxxx,X Load xx:xxxx+X to A BDxxxx LDA xxxx,X Load DB:xxxx+X to A BCxxxx LDY xxxx,X Load DB:xxxx+X to Y B9xxxx LDA xxxx,Y Load DB:xxxx+Y to A BExxxx LDX xxxx,Y Load DB:xxxx+Y to X A3xx LDA xx,S Load DB:00xx+S to A B5xx LDA xx,X Load DB:00xx+DP+X to A B4xx LDY xx,X Load DB:00xx+DP+X to Y B6xx LDX xx,Y Load DB:00xx+DP+Y to X A7xx LDA [xx] Load yy:yyyy from DB:00xx+DP to A B2xx LDA (xx) Load DB:yyyy from DB:00xx+DP to A B7xx LDA [xx],Y Load yy:yyyy from [DB:00xx+DP] + Y to A B1xx LDA (xx),Y Load DB:yyyy from [DB:00xx+DP] + Y to A A1xx LDA (xx,X) Load DB:yyyy from [DB:00xx+DP+X] to A B3xx LDA (xx,S),Y Load DB:yyyy from [DB:00xx+DP+S] + Y to A C9xxxx CMP #xxxx Compare #xxxx to A. (Subtract value from accumlator, setting the PSR without storing the result) E0xxxx CPX #xxxx Compare #xxxx to X C0xxxx CPY #xxxx Compare #xxxx to Y CFxxxxxx CMP xxxxxx Compare xx:xxxx to A CDxxxx CMP xxxx Compare DB:xxxx to A ECxxxx CPX xxxx Compare DB:xxxx to X CCxxxx CPY xxxx Compare DB:xxxx to Y C5xx CMP xx Compare DB:00xx+DP to A E4xx CPX xx Compare DB:00xx+DP to X C4xx CPY xx Compare DB:00xx+DP to Y DFxxxxxx CMP xxxxxx,X Compare xx:xxxx+X to A DDxxxx CMP xxxx,X Compare DB:xxxx+X to A D9xxxx CMP xxxx,Y Compare DB:xxxx+Y to A C3xx CMP xx,S Compare DB:00xx+S to A D5xx CMP xx,X Compare DB:00xx+DP+X to A C7xx CMP [xx] Compare yy:yyyy at DB:00xx+DP to A D2xx CMP (xx) Compare DB:yyyy at DB:00xx+DP to A D7xx CMP [xx],Y Compare yy:yyyy at [DB:00xx+DP] + Y to A D1xx CMP (xx),Y Compare DB:yyyy at [DB:00xx+DP] + Y to A C1xx CMP (xx,X) Compare DB:yyyy at [DB:00xx+DP+X] to A D3xx CMP (xx,S),Y Compare DB:yyyy at [DB:00xx+DP+S] + Y to A 8Fxxxxxx STA xxxxxx Store A to xx:xxxx 8Dxxxx STA xxxx Store A to DB:xxxx 8Exxxx STX xxxx Store X to DB:xxxx 8Cxxxx STY xxxx Store Y to DB:xxxx 9Cxxxx STZ xxxx Store 0 to DB:xxxx 85xx STA xx Store A to DB:00xx+DP 86xx STX xx Store X to DB:00xx+DP 84xx STY xx Store Y to DB:00xx+DP 64xx STZ xx Store 0 to DB:00xx+DP 9Fxxxxxx STA xxxxxx,X Store A to xx:xxxx+X 9Dxxxx STA xxxx,X Store A to DB:xxxx+X 9Exxxx STZ xxxx,X Store 0 to DB:xxxx+X 99xxxx STA xxxx,Y Store A to DB:xxxx+Y 83xx STA xx,S Store A to DB:00xx+S 95xx STA xx,X Store A to DB:00xx+DP+X 94xx STY xx,X Store Y to DB:00xx+DP+X 74xx STZ xx,X Store 0 to DB:00xx+DP+X 96xx STX xx,Y Store X to DB:00xx+DP+Y 87xx STA [xx] Store A to yy:yyyy at DB:00xx+DP 92xx STA (xx) Store A to DB:yyyy at DB:00xx+DP 97xx STA [xx],Y Store A to yy:yyyy at [DB:00xx+DP] + Y 91xx STA (xx),Y Store A to DB:yyyy at [DB:00xx+DP] + Y 81xx STA (xx,X) Store A to DB:yyyy at [DB:00xx+DP+X] 93xx STA (xx,S),Y Store A to DB:yyyy at [DB:00xx+DP+S] + Y -------- 69xxxx ADC #xxxx Add #xxxx + C to A 6Fxxxxxx ADC xxxxxx Add xx:xxxx + C to A 6Dxxxx ADC xxxx Add DB:xxxx + C to A 65xx ADC xx Add DB:00xx+DP + C to A 7Fxxxxxx ADC xxxxxx,X Add xx:xxxx+X + C to A 7Dxxxx ADC xxxx,X Add DB:xxxx+X + C to A 79xxxx ADC xxxx,Y Add DB:xxxx+Y + C to A 63xx ADC xx,S Add DB:00xx+S + C to A 75xx ADC xx,X Add DB:00xx+DP+X + C to A 67xx ADC [xx] Add yy:yyyy + C at DB:00xx+DP to A 72xx ADC (xx) Add DB:yyyy + C at DB:00xx+DP to A 77xx ADC [xx],Y Add yy:yyyy at [DB:00xx+DP] + Y to A 71xx ADC (xx),Y Add DB:yyyy at [DB:00xx+DP] + Y to A 61xx ADC (xx,X) Add DB:yyyy at [DB:00xx+DP+X] to A 73xx ADC (xx,S),Y Add DB:yyyy at [DB:00xx+DP+S] + Y to A E9xxxx SBC #xxxx Subtract #xxxx + c from A EFxxxxxx SBC xxxxxx Subtract xx:xxxx + c from A EDxxxx SBC xxxx Subtract DB:xxxx + c from A E5xx SBC xx Subtract DB:00xx+DP + c from A FFxxxxxx SBC xxxxxx,X Subtract xx:xxxx+X + c from A FDxxxx SBC xxxx,X Subtract DB:xxxx+X + c from A F9xxxx SBC xxxx,Y Subtract DB:xxxx+Y + c from A E3xx SBC xx,S Subtract DB:00xx+S + c from A F5xx SBC xx,X Subtract DB:00xx+DP+X + c from A E7xx SBC [xx] Subtract yy:yyyy + c at DB:00xx+DP from A F2xx SBC (xx) Subtract DB:yyyy + c at DB:00xx+DP from A F7xx SBC [xx],Y Subtract yy:yyyy at [DB:00xx+DP] + Y from A F1xx SBC (xx),Y Subtract DB:yyyy at [DB:00xx+DP] + Y from A E1xx SBC (xx,X) Subtract DB:yyyy at [DB:00xx+DP+X] from A F3xx SBC (xx,S),Y Subtract DB:yyyy at [DB:00xx+DP+S] + Y from A 29xxxx AND #xxxx AND A by #xxxx 2Fxxxxxx AND xxxxxx AND A by xx:xxxx 2Dxxxx AND xxxx AND A by DB:xxxx 25xx AND xx AND A by DB:00xx+DP 3Fxxxxxx AND xxxxxx,X AND A by xx:xxxx+X 3Dxxxx AND xxxx,X AND A by DB:xxxx+X 39xxxx AND xxxx,Y AND A by DB:xxxx+Y 23xx AND xx,S AND A by DB:00xx+S 35xx AND xx,X AND A by DB:00xx+DP+X 27xx AND [xx] AND A by yy:yyyy at DB:00xx+DP 32xx AND (xx) AND A by DB:yyyy at DB:00xx+DP 37xx AND [xx],Y AND A by yy:yyyy at [DB:00xx+DP] + Y 31xx AND (xx),Y AND A by DB:yyyy at [DB:00xx+DP] + Y 21xx AND (xx,X) AND A by DB:yyyy at [DB:00xx+DP+X] 33xx AND (xx,S),Y AND A by DB:yyyy at [DB:00xx+DP+S] + Y 09xxxx ORA #xxxx OR #xxxx to A 0Fxxxxxx ORA xxxxxx OR xx:xxxx to A 0Dxxxx ORA xxxx OR DB:xxxx to A 05xx ORA xx OR DB:00xx+DP to A 1Fxxxxxx ORA xxxxxx,X OR xx:xxxx+X to A 1Dxxxx ORA xxxx,X OR DB:xxxx+X to A 19xxxx ORA xxxx,Y OR DB:xxxx+Y to A 03xx ORA xx,S OR DB:00xx+S to A 15xx ORA xx,X OR DB:00xx+DP+X to A 07xx ORA [xx] OR yy:yyyy at DB:00xx+DP to A 12xx ORA (xx) OR DB:yyyy at DB:00xx+DP to A 17xx ORA [xx],Y OR yy:yyyy at [DB:00xx+DP] + Y to A 11xx ORA (xx),Y OR DB:yyyy at [DB:00xx+DP] + Y to A 01xx ORA (xx,X) OR DB:yyyy at [DB:00xx+DP+X] to A 13xx ORA (xx,S),Y OR DB:yyyy at [DB:00xx+DP+S] + Y to A 49xxxx EOR #xxxx XOR #xxxx with A 4Fxxxxxx EOR xxxxxx XOR xx:xxxx with A 4Dxxxx EOR xxxx XOR DB:xxxx with A 45xx EOR xx XOR DB:00xx+DP with A 5Fxxxxxx EOR xxxxxx,X XOR xx:xxxx+X with A 5Dxxxx EOR xxxx,X XOR DB:xxxx+X with A 59xxxx EOR xxxx,Y XOR DB:xxxx+Y with A 43xx EOR xx,S XOR DB:00xx+S with A 55xx EOR xx,X XOR DB:00xx+DP+X with A 47xx EOR [xx] XOR yy:yyyy at DB:00xx+DP with A 52xx EOR (xx) XOR DB:yyyy at DB:00xx+DP with A 57xx EOR [xx],Y XOR yy:yyyy at [DB:00xx+DP] + Y with A 51xx EOR (xx),Y XOR DB:yyyy at [DB:00xx+DP] + Y with A 41xx EOR (xx,X) XOR DB:yyyy at [DB:00xx+DP+X] with A 53xx EOR (xx,S),Y XOR DB:yyyy at [DB:00xx+DP+S] + Y with A -------- 89xxxx BIT #xxxx Bit test A by #xxxx. (AND value with accumulator, setting PSR.Z without storing the result) 2Cxxxx BIT xxxx Bit test A by DB:xxxx. (For non-immediate address modes, BIT also sets PSR.N and PSR.V to bit15 and bit14 respectively of the memory data) 24xx BIT xx Bit test A by DB:00xx+DP 3Cxxxx BIT xxxx,X Bit test A by DB:xxxx+X 34xx BIT xx,X Bit test A by DB:00xx+DP+X 0Cxxxx TSB xxxx OR A to DB:xxxx. (Test and set bits A of xxxx) 04xx TSB xx OR A to DB:00xx+DP 1Cxxxx TRB xxxx Bit clear DB:xxxx by A. (Test and reset bits A of xxxx) 14xx TRB xx Bit clear DB:00xx+DP by A -------- 1A INC A (INA) Increment A E8 INX Increment X C8 INY Increment Y EExxxx INC xxxx Increment DB:xxxx E6xx INC xx Increment DB:00xx+DP FExxxx INC xxxx,X Increment DB:xxxx+X F6xxxx INC xx,X Increment DB:00xx+DP+X 3A DEC A (DEA) Decrement A CA DEX Decrement X 88 DEY Decrement Y CExxxx DEC xxxx Decrement DB:xxxx C6xx DEC xx Decrement DB:00xx+DP DExxxx DEC xxxx,X Decrement DB:xxxx+X D6xx DEC xx,X Decrement DB:00xx+DP+X 0A ASL A Arithmetic shift A left 0Exxxx ASL xxxx Arithmetic shift DB:xxxx left 06xx ASL xx Arithmetic shift DB:00xx+DP left 1Exxxx ASL xxxx,X Arithmetic shift DB:xxxx+X left 16xx ASL xx,X Arithmetic shift DB:00xx+DP+X left 2A ROL A Rotate A left 2Exxxx ROL xxxx Rotate DB:xxxx left 26xx ROL xx Rotate DB:00xx+DP left 3Exxxx ROL xxxx,X Rotate DB:xxxx+X left 36xx ROL xx,X Rotate DB:00xx+DP+X left 4A LSR A Shift A right 4Exxxx LSR xxxx Shift DB:xxxx right 46xx LSR xx Shift DB:00xx+DP right 5Exxxx LSR xxxx,X Shift DB:xxxx+X right 56xx LSR xx,X Shift DB:00xx+DP+X right 6A ROR A Rotate A right 6Exxxx ROR xxxx Rotate DB:xxxx right 66xx ROR xx Rotate DB:00xx+DP right 7Exxxx ROR xxxx,X Rotate DB:xxxx+X right 76xx ROR xx,X Rotate DB:00xx+DP+X right -------- 5Cxxxxxx JMP xxxxxx (JML) Jump to xx:xxxx 4Cxxxx JMP xxxx Jump to DB:xxxx DCxxxxxx JMP [xxxxxx] (JML) Jump to yy:yyyy at xx:xxxx 6Cxxxx JMP (xxxx) Jump to DB:yyyy at DB:xxxx 7Cxxxx JMP (xxxx,X) Jump to DB:yyyy at DB:xxxx+X 22xxxxxx JSR xxxxxx (JSL) Push PC and jump to xx:xxxx 20xxxx JSR xxxx Push PC and jump to DB:xxxx FCxxxx JSR (xxxx,X) Push PC and jump to DB:yyyy at DB:xxxx+X -------- 82xxxx BRL xxxx Branch to PC+±#xxxx 80xx BRA xx Branch to PC+±#xx 90xx BCC xx (BLT) Branch to PC+±#xx if carry clear (PSR.c). (Lower than) B0xx BCS xx (BGE) Branch to PC+±#xx if carry set (PSR.C). (Higher than or equal to) F0xx BEQ xx Branch to PC+±#xx if equal. (PSR.Z). (Equal to zero) D0xx BNE xx Branch to PC+±#xx if not equal. (PSR.z). (Not equal to zero) 30xx BMI xx Branch to PC+±#xx if minus. (PSR.N). (Less than) 10xx BPL xx Branch to PC+±#xx if plus. (PSR.n). (Greater than or equal to) 50xx BVC xx Branch to PC+±#xx if overflow clear (PSR.v) 70xx BVS xx Branch to PC+±#xx if overflow set (PSR.V) -------- 02xx COP Jump to 00:yyyy at 00:FFF4. (Coprocessor interrupt). (xx < 80h) 00xx BRK Jump to 00:yyyy at 00:FFE6. (Break). (xx is a signature, it isn't read and is skipped over for the return address) -------- 40 RTI Return from interrupt 60 RTS Return from subroutine 6B RTL Long return from subroutine -------- F4xxxx PEA xxxx Push #xxxx. (Push effective absolute) D4xx PEI (xx) Push DB:00xx+DP. (Push effective indirect) 62xxxx PER xxxx Push PC+±#xxxx. (Push effective PC-relative) 48 PHA Push A 08 PHP Push PSR (processor status register) DA PHX Push X 5A PHY Push Y 8B PHB Push DB (data bank) 0B PHD Push DP (direct page) 4B PHK Push PB (program bank) 68 PLA Pull A FA PLX Pull X 7A PLY Pull Y 2B PLD Pull direct page AB PLB Pull data bank 28 PLP Pull processor flags -------- AA TAX Transfer A to X A8 TAY Transfer A to Y 1B TCS (TAS) Transfer A to S 5B TCD (TAD) Transfer A to direct page 8A TXA Transfer X to A 9B TXY Transfer X to Y 9A TXS Transfer X to S 98 TYA Transfer Y to A BB TYX Transfer Y to X 3B TSC (TSA) Transfer S to A BA TSX Transfer S to X 7B TDC (TDA) Transfer direct page to A EB XBA (SWA) Exchange significant bytes of A -------- E2xx SEP #xx Set PSR bytes #xx C2xx REP #xx Reset (clear) PSR bits #xx 18 CLC Clear carry D8 CLD Clear decimal 58 CLI Clear interrupt B8 CLV Clear overflow 38 SEC Set carry F8 SED Set decimal 78 SEI Set interrupt FB XCE Exchange carry and emulation flags -------- CB WAI Wait for interrupt. (If PSR.I, PC is returned to instead of IRQ vector) DB STP Stop processor -------- EA NOP Wait 2 cycles 42 WDM Reserved (William David Mensch Jr., 65816 designer) -------- 54yyxx MVN xx yy Move xx:X to yy:Y, increment X&Y Decrement A, loop until A underflows. (DB = yy) 44yyxx MVP xx yy Move xx:X to yy:Y, decrement X&Y Decrement A, loop until A underflows. (DB = yy) ---------------- For even n: 00 20 40 60 80 A0 C0 E0 n0 = ooo BRK RTI RTS n0 = JSR xxxx JSR n0 = BRA xx BRA n0 = ooo #xxxx LDY CPY CPX n1 = ooo (xx,X) ORA AND EOR ADC STA LDA CMP SBC n2 = ooo COP WDM n2 = JSR xxxxxx JSR n2 = ooo xxxx PER BRL n2 = LDX #xxxx LDX n2 = oEP #xx REP SEP n3 = ooo xx,S ORA AND EOR ADC STA LDA CMP SBC n4 = ooo xx TSB BIT STZ STY LDY CPY CPX n4 = MVP xx yy MVP n5 = ooo xx ORA AND EOR ADC STA LDA CMP SBC n6 = ooo xx ASL ROL LSR ROR STX LDX DEC INC n7 = ooo [xx] ORA AND EOR ADC STA LDA CMP SBC n8 = ooo PHP PLP PHA PLA DEY TAY INY INX n9 = ooo #xxxx ORA AND EOR ADC BIT LDA CMP SBC nA = ooo ASL ROL LSR ROR TXA TAX DEC NOP nB = ooo PHD PLD PHK RTL PHB PLB WAI XBA nC = ooo xxxx TSB BIT JMP STY LDY CPY CPX nC = JMP (xxxx) JMP nD = ooo xxxx ORA AND EOR ADC STA LDA CMP SBC nE = xxxx ASL ROL LSR ROR STX LDX DEC INC nF = ooo xxxxxx ORA AND EOR ADC STA LDA CMP SBC -------- For odd n: 10 30 50 70 90 B0 D0 F0 n0 = Boo xx BPL BMI BVC BVS BCC BCS BNE BEQ n1 = ooo (xx),Y ORA AND EOR ADC STA LDA CMP SBC n2 = ooo (xx) ORA AND EOR ADC STA LDA CMP SBC n3 = ooo (xx,S),Y ORA AND EOR ADC STA LDA CMP SBC n4 = ooo xx TRB n4 = ooo xx,X BIT STZ STY LDY n4 = MVN xx yy MVN n4 = PEI (xx) PEI n4 = PEA xxxx PEA n5 = ooo xx,X ORA AND EOR ADC STA LDA CMP SBC n6 = ooo xx,X ASL ROL LSR ROR STX LDX DEC INC n7 = ooo [xx],Y ORA AND EOR ADC STA LDA CMP SBC n8 = ooo CLC SEC CLI SEI TYA CLV CLD SED n9 = ooo xxxx,Y ORA AND EOR ADC STA LDA CMP SBC nA = ooo INC DEC PHY PLY TXS TSX PHX PLX nB = ooo TCS TSC TCD TDC TXY TYX STP XCE nC = ooo xxxx TRB STZ nC = ooo xxxx,X BIT LDY nC = JMP xxxxxx JMP nC = JMP (xxxx,X) JMP nC = JMP [xxxxxx] JMP nC = JSR (xxxx,X) JSR nD = ooo xxxx,X ORA AND EOR ADC STA LDA CMP SBC nE = ooo xxxx,X ASL ROL LSR ROR LDX STZ DEC INC nF = ooo xxxxxx,X ORA AND EOR ADC STA LDA CMP SBC